home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _editors / editors / _zap / !Zap / Docs / E-Zapcalls < prev    next >
Text File  |  1994-10-12  |  46KB  |  1,082 lines

  1. *************************************************************************
  2. * >E-ZapCalls    Documentation of Zap entry points (how to call Zap)    *
  3. *************************************************************************
  4.  
  5. Zap does NOT have a SWI interface as it uses registers R8-R10 to point to
  6. data blocks, and these cannot be passed to swi's. To call Zap you will need
  7. to know the address of the Zap module workspace (ie it's private word). If
  8. you are an extension mode then this will be passed to you in R12 whenever you
  9. are called by one of your entry points. However, for the first call you make
  10. to Zap, when you add your module to it's list via Zap_Addmode, you will not
  11. know it. Then you should use OS_Module 18 to find it. Eg,
  12.  
  13.  SYS "XOS_Module",18,"Zap" TO R0,R1,R2,R3,workspace%
  14.  
  15. Now, the first word in Zap's workspace contains the address of a table of
  16. Zap's entry points. Thus to call the entry point (documented below) at offset
  17. a% I suggest you use the basic macro given below.
  18.  
  19.     REM Call Zap at entry offset a%
  20.     REM Entry: R0-R11=args R12=zap workspace
  21.     REM Exit : R0-R11=returned values R12 preserved R14 corrupted
  22.     
  23.     DEF FNcall(a%)
  24.     [OPTpass
  25.     LDR R14,[R12]        \ get start of zap table
  26.     ADD R14,R14,#a%        \ address of the sub
  27.     STMFD R13!,{R14}        \ save address on stack
  28.     MOV R14,PC            \ return address (with flags)
  29.     LDMFD R13!,{PC}        \ call the sub 
  30.     ]:=""
  31.  
  32. The names of the routines are listed below in the order in which they appear
  33. in the table. Thus the first, Zap_AddMode, is at offset 0. The second,
  34. Zap_Claim is at offset 4, etc. These values are defined for you in the
  35. program E-Library.
  36.  
  37. In general these routines have the following entry/exit conditions:
  38.  
  39.  \E R0-R11=arguments R12=Zap's workspace R13=user stack R14=return address
  40.  \X R1-R13 preserved. R0 and Flags ALTERED. V set if error and R0=error block
  41.  
  42. Thus if I write:
  43.  
  44.  \E R8
  45.  \X R1=3
  46.  
  47. Then I mean that on entry R8 was the window block pointer, R12 zap's
  48. workspace etc. And on exit that R1=3, R2-R13 saved, R0 corrupted etc. If I
  49. omit the \E or \X then I mean the standard entry/exit conditions hold.
  50.  
  51. Errors should be passed back to Zap by the entry point through which the
  52. module was called (with V flag set and R0=error block pointer). Please note
  53. that for most calls, Zap must be paged in as the current task! This will be
  54. so if you are an extension mode.
  55.  
  56. For a table/summary of the zap call names for including in your source, see
  57. the file E-Library.
  58.  
  59. Zap_AddMode
  60. Adds a new Zap extension mode. This should be called after the module Zap is
  61. loaded, but before it starts up as a new task. Zap need not be paged in for
  62. this call.
  63.     \E R0=address of table of entry points (see file E-Entry)
  64.  
  65. Zap_Claim
  66. Claims a block of workspace in Zap's heap.
  67.     \E R0=number of bytes required
  68.     \X R0=pointer to the heap block
  69.  
  70. Zap_Ensure
  71. Ensures a zap heap block is of a given size.
  72.     \E R0=pointer to the heap block
  73.        R1=number of bytes required.
  74.     \X R0=new heap block pointer of (possibly moved) extended block.
  75.        (An error is returned if the block couldn't be enlarged).
  76.  
  77. Zap_Free
  78. Free a zap heap block after use.
  79.     \E R0=pointer to heap block to free
  80.  
  81. Zap_MoveBytes
  82. Moves a block of memory. The movement may be up or down by any amount. The
  83. data is ALWAYS preserved no matter where the destination is. This routine is
  84. highly optimised and should be used for moving any large block of data. Zap
  85. need not be paged in.
  86.     \E R1=source byte address
  87.        R2=destination byte address
  88.        R3=number of bytes to move
  89.     \X R1-R3 corrupted
  90.  
  91. Zap_SplitBuffer
  92. This splits a file held in Zap at the indicated file offset ready for
  93. insertion/deletion of data. It also ensures that file buffer has a given
  94. amount of room free. See E-File.
  95.     \E R0=file offset to split at (new value for f_splito)
  96.        R1=minimum number of bytes to have free in the split
  97.        R9=file to be split
  98.  
  99. Zap_NewTxtStatus
  100. This updates the screen after changes are made to a file. This is very low
  101. level and you should use Zap_Command when possible. Zap_SaveTxtStatus should
  102. be called first.
  103.     \E R0/R1 as for SaveTxtStatus and R2=new input caret offset.
  104.  
  105. Zap_SaveTxtStatus
  106. This is a low level call used by Zap_DoCommand when changing a file. You
  107. should use Zap_Command/Zap_DoCommand in preference. Any file changes done
  108. using this call are NOT saved in the undo buffer. Ie, don't use it. To use it
  109. you specify the area of the file to be changed (R0 to R2) and the amount of
  110. the change (in R1). After making the change you use Zap_NewTxtStatus to
  111. update the screen. Set f_docom to 0 if in doubt.
  112.     \E R0=file offset of first byte in file to be changed.
  113.        R1=proposed signed change in size of file.
  114.        R2=file offset of first character which is unchanged.
  115.        f_docom,f_dolen,f_dodata must be set up - see e_prevline.
  116.  
  117. Zap_Command
  118. This should be used for inserting/deleting/replacing data in a file. Its 
  119. action is to call the mode entry point named e_command. See E-Entry. The
  120. mode's default action is then to call Zap_DoCommand. The commands are
  121. automatically placed in the undo buffer. If you are doing a sequence of
  122. insertions/deletions then please use Zap_Start/StopOp. Note that the cursor
  123. is automatically updated to the end of the inserted/deleted region. To
  124. prevent this, set b14 of f_flags, but you MUST restore it after the command
  125. returns.
  126.     \E R0=command number: 1=insert 2=delete 3=replace (forward)
  127.         4=replace (backward). Add &10 if command is to be buffered
  128.         in one block (and thus undone in one key press).
  129.        R1=file offset for command to take place at.
  130.        R2=number of bytes being inserted/deleted/replaced.
  131.        R3=data to insert/replace with for commands 1,3,4.
  132.        R8=window on file to be altered/0 if none.
  133.        R9=file to be altered.
  134.     NB If you don't specify the window then it won't know which mode to
  135.     call, so this command will just call Zap_DoCommand.
  136.  
  137. Zap_NewWinStatus
  138. This recreates a window after some display parameters have changed. Use
  139. Zap_SaveWinStatus before changing any parameters.
  140.     \E R8/R9
  141.     
  142. Zap_SaveWinStatus
  143. This is used before changing any of the 'w_*' window parameters which would
  144. effect the display. See E-Window. The current cursor position, scroll offsets
  145. etc are saved. After changing the window parameters call Zap_NewWinStatus.
  146. Zap will do it's best to recreate the window with the new attributes,
  147. preserving the position of the cursor on screen.
  148.     \E R8/R9
  149.  
  150. Zap_ReplaceArea
  151. This command replaces one area of text with another (not necessarily of the
  152. same length) by performing the minimum number of insertions/deletions/simple
  153. replaces using Zap_Command. In BASIC mode it also retokenises the line as
  154. necessary. This is used during a search and replace. See mode entry point
  155. e_replace.
  156.     \E R1=file offset of original data
  157.        R2=length of original data
  158.        R3=address of replacement data
  159.        R4=length of replacement data R8/R9
  160.        
  161. Zap_PlotCaret
  162. This command plots a caret in its new position automatically removing it from
  163. its old position. Ie, it just calls Zap_ClearCaret then Zap_SetCaret.
  164.     \E R10=caret block
  165.  
  166. Zap_ReflectCaret
  167. This acts as Zap_PlotCaret but only uses c_off, updating the c_loff and c_col
  168. offsets from this. Ie, it just calls Zap_UpdateCaret then Zap_PlotCaret.
  169.     \E R10=caret block
  170.  
  171. Zap_SetCaret
  172. This updates the area of the window containing the the caret given on entry.
  173. Hence it's effect is usually to draw the caret at it's (new) position. See
  174. E-Cursors.
  175.     \E R10=caret block
  176.  
  177. Zap_ClearCaret
  178. As for Zap_SetCaret, but it updates the area of the window where the caret
  179. last was (stored in the c_o* variables). Hence the caret is in effect removed
  180. from its old position. See E-Cursors.
  181.     \E R10=caret block
  182.  
  183. Zap_DoCommand
  184. This acts as Zap_Command but actually performs the action rather than
  185. calling the extension mode.
  186.     \E As for Zap_Command.
  187.  
  188. Zap_ShowCursor
  189. This call makes sure that a given cursor can be seen in its window (by
  190. changing the scroll offsets if necessary). It does not redraw the cursor
  191. in general (though changing the scroll offsets may cause it to be redrawn).
  192.     \E R10=cursor block of cursor to show
  193.  
  194. Zap_ReadVar
  195. Reads one of Zaps internal variables. See the file E-Vars for the numbers.
  196.     \E R1=variable number.
  197.     \X R0=variable value.
  198.  
  199. Zap_WriteVar
  200. Writes one of zaps internal variables. See the file E-Vars for the numbers.
  201.     \E R1=variable number
  202.        R0=new value
  203.  
  204. Zap_SaveFile
  205. This saves a file to disc (using f_name as the file name). The file may not
  206. actually be saved if a dialogue box is opened. (Eg: 'file is older than
  207. version on disc box'). Please note the value of R0 on exit!
  208.     \E R8/R9 = window to save
  209.     \X R0=0  => File has been saved to disc - you can now delete it.
  210.        R0=-1 => File has not yet been saved - warning window opened /
  211.                data transfer initiated.
  212.  
  213. Zap_FillWords
  214. Fast word filling code. The block must be word aligned. Zap need not be paged
  215. in.
  216.     \E R1=word to fill with.
  217.        R2=address of memory to fill (word aligned).
  218.        R3=number of bytes to fill (a multiple of 4).
  219.     \X R0-R3 corrupted.
  220.  
  221. Zap_UpdateLns
  222. This updates the line numbers column of a given window. This is usually done
  223. automatically by Zap_Command. This is used by the BASIC mode on a renumber.
  224.     \E R0=first physical line to start from R8/R9
  225.  
  226. Zap_EachWindow
  227. This sub calls a given sub for each window on a given file. Each time it
  228. calls the sub pointed to in R10, it sets up R8 for that window.
  229.     \E R0-R7=args to pass to the sub.
  230.        R9=file (whose windows you are to call).
  231.        R10=address of sub to call for each window on this file.
  232.     The sub called has:
  233.         \E R0-R7 as set up by you
  234.            R8/R9 points to the given window
  235.         \X Must preserve R1-R11 and VS on error etc.
  236.  
  237. Zap_UpdateCaret
  238. This sub is called to update a caret position from a given file offset. Save
  239. the new offset of the caret in c_off. Call this. Then c_col, c_line, c_loff,
  240. c_width will be set up. See E-Cursors.
  241.     \E R10=caret block
  242.  
  243. Zap_GetWindState
  244. Updates the window block R8 (first few entries) by calling
  245. Wimp_GetWindowState.
  246.     \E R8
  247.  
  248. Zap_StartOp
  249. Starts a sequence of operations. This should be used when performing a
  250. sequence of calls to Zap_Command. It causes all the file changes to be made
  251. with only ONE screen refresh, thus giving a much smoother update. After this
  252. has been called, all subsequent calls to Zap_Command before a Zap_StopOp call
  253. have their actions concatenated. When you call Zap_StopOp the screen is then
  254. updated. You MUST call Zap_StopOp before returning to Wimp_Poll. StartOp/
  255. StopOp's can be nested to any depth (so only the last StopOp actually causes
  256. the screen to be updated).
  257.     \E R9=file which will be operated on.
  258.  
  259. Zap_StopOp
  260. Ends a StartOp/StopOp structure.
  261.     \E R9=file which has been operated on.
  262.     \X If VC on entry then R0 corrupted and R1-R11 preserved as usual.
  263.        If VS on entry then error pointer in R0 and V flag status are
  264.        also preserved.
  265.  
  266. Zap_CallMode
  267. Calls a mode entry point. See E-Entry for a list of entry points. The mode
  268. called is the mode of the window given in R8.
  269.     \E R0-R10=parameters R8 R11=mode entry point offset
  270.     \X As for the given mode entry point.
  271.  
  272. Zap_CallGivenMode
  273. Calls a mode entry point of a specified mode.
  274.     \E R0-R9=parameters R10=mode number R11=entry point offset
  275.     \X As for the given mode entry point.
  276.  
  277. Zap_ReadMode
  278. Read the address of the mode entry point tables. Two pointers are returned.
  279. The first (R0) is a pointer to the mode table as stored in the extension
  280. module and documented in E-Entry. The second (R1) points to a table of actual
  281. addresses to be called, with entry points which were null in the original
  282. table converted to addresses and all offsets converted to addresses. In this
  283. table, each entry consists of 8 bytes. The first 4 bytes gives the address of
  284. the entry point, and the next 4 the value to pass in R11 when the entry point
  285. is called. This will obviously vary if some mode entry points are based on
  286. other modes. Thus the linked table has the form:
  287.     e_module    #0    module address,    module workspace address
  288.     e_title        #8    title address,    undefined
  289.     e_author    #16    author address,    undefined
  290.     e_basemode    #24    basemode,    undefined
  291.     e_mode        #32    mode number,    undefined
  292.     e_init        #40    init code addr,    value to pass in R11
  293.     e_menu        #48    wimp menu data,    undefined
  294.     e_len        #56    undefined,    undefined
  295.     e_postload    #64    postload addr,    value to pass in R11
  296.      and the rest as for e_postload.
  297. I reserved the right to use the undefined words in future. You can change the
  298. table entries pointer to in R1, but I don't advise it :-)
  299.     \E R0=mode number.
  300.     \X R0=pointer to unlinked table in modes module / <=0 if invalid
  301.        R1=pointer to linked table in zaps workspace / <=0 if invalid
  302.  
  303. Zap_FindFile
  304. Given the name of a file, this call produces a window on that file (loading
  305. it if necessary). Path is canonicalised before comparing with currently
  306. loaded files.
  307.     \E R0=file name.
  308.     \X R8/R9=window on that file.
  309.  
  310. Zap_FindWindow
  311. Given a file block pointer of a file already loaded, this call produces a
  312. window block pointer of a window on that file (opening it if necessary).
  313.     \E R9
  314.     \X R8
  315.  
  316. Zap_ConvWindOff
  317. Converts a window offset to a window block pointer. See E-Windows.
  318.     \E R0=offset of a window in the window list /-ve
  319.     \X R8/R9=window and file /0
  320.  
  321. Zap_ConvFileOff
  322. Converts a file offset to a file block pointer. See E-File.
  323.     \E R0=offset of a file in the file list/-ve
  324.     \X R9=pointers to the file block/0
  325.  
  326. Zap_GetWindOff
  327. Converts a window block pointer to a window offset. See E-Windows.
  328.     \E R8=window block pointer/0
  329.     \X R0=offset in the window list/-ve
  330.  
  331. Zap_GetFileOff
  332. Converts a file block pointer to a file offset. See E-File.
  333.     \E R9=file block pointer/0
  334.     \X R0=offset in the file list/-ve
  335.  
  336. Zap_GotoOffset
  337. This call causes the given cursor to jump to a given file offset, leaving a
  338. mark behind at the previous position.
  339.     \E R0=offset to go to R8-R9=file R10=cursor
  340.  
  341. Zap_JumptoOffset
  342. As for GotoOffset but no mark left on jumping.
  343.     \E R0=offset to go to R8-R9=file R10=cursor
  344.  
  345. Zap_FindOffset
  346. Given the (x,y) position in work area characters, finds the file offset of
  347. the 'nearest' point in the file. See E-Windows.
  348.     \E R2=x column (inc margin) R3=y row (from top)
  349.     \X R0=file offset R1=file offset of physical line start R2/R3 clipped
  350.  
  351. Zap_NewFileTitle
  352. Update the titlebars of all windows on a given file.
  353.     \E R9=file
  354.  
  355. Zap_InsertString
  356. Inserts a string at the end of a buffer using Zap_Command.
  357.     \E R0=zero terminated string R8/R9
  358.  
  359. Zap_CreateFile
  360. Creates an empty file, possibly changing the opt_flags/format via BIC 'mask'
  361. EOR 'eor' when creating it. See E-Flags, E-Windows. It calls
  362. Zap_CreateWindBlock and Zap_CreateFileBlock etc.
  363.     \E R0=file type
  364.        R1=flags mask
  365.        R2=flags eor
  366.        R3=format mask
  367.        R4=format eor
  368.     \X R8/R9=newly created file (with open window).
  369.  
  370. Zap_NewLinkEntry
  371. Adds a new link entry to the f_links list. See E-File for description of the
  372. links list format. This is a low-level call. Use Zap_Throwback in preference.
  373. This is used by throwback. A new block is created if the file name does not
  374. match that of the previous link block, or the flags differ. The point of the
  375. links is that they are updated when changes are made to the indicated file.
  376.     \E R0=data word (Ie file offset of link / line number of link
  377.           depending on flags in R5).
  378.        R1=filename (Of the file that R0 is an offset in).
  379.        R4=file offset/-1 (Ie, offset in file list of the file named in
  380.            R1 if the file is loaded, or -1 if you don't know if the file
  381.            is loaded or not - usually safest to put as -1).
  382.        R5=flags (as documented under f_links in E-File).
  383.        R9=file to which the link should be added - ie this is the
  384.           throwback buffer file as opposed to R1 which is the file giving
  385.           the C program / file which was searched through.
  386.     \X R0=0 if link added to last list entry/1 if new entry created.
  387.  
  388. Zap_DefaultClick
  389. Calls the default mouse click handling code. See the entry point e_click.
  390.     \E R1=depth (0=drag 1=click 2=double click etc)
  391.        R2=x R3=y
  392.        R4=buttons
  393.        R8/R9 as for e_click.
  394.  
  395. Zap_PutCaret
  396. Sets standard cursor editing mode and puts the cursor caret at a given file
  397. offset in a given file.
  398.     \E R0=file offset R8/R9=file
  399.  
  400. Zap_DiscardFile
  401. Kill a file and all windows on that file without prompting user.
  402.     \E R9=file
  403.  
  404. Zap_DeleteFile
  405. As for Zap_DiscardFile but prompts user if file altered etc.
  406.     \E R9=file
  407.  
  408. Zap_DiscardWindow
  409. Kill a window, and the file if auto-delete is on and this is the last window
  410. on that file. Don't prompt user.
  411.     \E R8/R9
  412.  
  413. Zap_DeleteWindow
  414. As for Zap_DiscardWindow but prompts user if file altered etc.
  415.     \E R8/R9
  416.  
  417. Zap_BuildMenu
  418. This is zaps 'variable length menu' building sub. See E-Menu for details on
  419. Zap's menu format.
  420.     \E R0=menu name (max 12 chars)
  421.        R1=address of sub to generate the menu entries
  422.        R2=address of menu updating sub/0 if none (see E-Menu)
  423.        R3=address of menu interpret sub for all entries/0 (see E-Menu)
  424.        R4=menu width in chars
  425.        R8-R11=values to call the sub in R1 with on the first call.
  426.     \X R0=pointer to wimp menu structure
  427.     The sub passed in R1 has the following conditions:
  428.          \E R0=buffer for you to put the next menu entry in (48 bytes)
  429.         R5=address of menu structure start }
  430.         R6=address of current menu entry   } you don't need these
  431.         R7=address of current buf entry    }
  432.         R8-R11=as returned from last call
  433.          \X R0=index for this entry/-1 if no more entries (see E-Menu)
  434.              R1-R7 saved
  435.              R8-R11=updated (ie for your own use).
  436.  
  437. Zap_ClearSel
  438. Clears currently selected area.
  439.  
  440. Zap_CreateFileBlock
  441. Creates a new file block with currently configured options. f_ptr etc are set
  442. up for you. See E-File. Use Zap_Install file to load a file.
  443.     \E R0=size to make buffer
  444.        R1=filename of buffer
  445.        R2/R3=load/exec
  446.     \X R9=new file block (with file filled with rubbish).
  447.     
  448. Zap_CreateWindBlk
  449. Creates a new window block with currently configured options. Window is
  450. opened on the screen etc.
  451.     \E R9=file window is to be on.
  452.     \X R8=New window on this file.
  453.     
  454. Zap_GetSel
  455. Find out what area is selected.
  456.     \X If CS then no valid selection
  457.        If CC then R1=file offset R2=selection length R8/R9=file
  458.  
  459. Zap_InsertMark
  460. Insert a marker.
  461.     \E R0=file offset of mark R8/R9
  462.  
  463. Zap_InstallFile
  464. Load a file into zap.
  465.     \E R0=filename
  466.     \X R0=window offset of created window / -1 if not loaded.
  467.  
  468. Zap_NewMode
  469. Change the display mode of a window.
  470.     \E R0=new mode number R8/R9 (R8=0 to change options mode)
  471.  
  472. Zap_NewTitle
  473. Update the titlebar on a given window. See also Zap_NewFileTitle.
  474.     \E R8/R9
  475.  
  476. Zap_CallBaseMode
  477. DO NOT USE THIS. This call is now obsolete. Use the call Zap_BaseMode
  478. instead. If you use this call it will appear to work perfectly until someone
  479. tries to use your mode as a base mode. When this happens an infinite loop
  480. occurs which I can't fix. The docs are kept for backwards compatibility.
  481. --------------------------------------------------------------------------
  482. As for Zap_CallMode except it calls the base mode instead. The window in R8
  483. identifies the current mode. The entry point called is that of the base mode
  484. associated to this current mode. Hence, it would be used by a mode to call
  485. a base mode entry point which the current mode has redefined.
  486.     \E R0-R10=parameters R8 R11=mode entry point offset (see E-Entry)
  487.     \X As for the given mode entry point.
  488.  
  489. Zap_NewView
  490. As for Zap_CreateWindBlk but 'clones' a given window image. The cursor is not
  491. put in the window.
  492.     \E R8/R9=window to clone from (R8=0 then don't clone)
  493.  
  494. Zap_ReadSel
  495. Reads the currently selected region into a heap block. You must free the heap
  496. block when you have finished with the selection.
  497.     \X R3=heap block with data and R2=length / R3=0 if no selection
  498.  
  499. Zap_Replace
  500. Calls the Zap file search and replace code using the current search string
  501. and current replace string.
  502.     \E R1=0 for selective/1 for global
  503.        R3=start offset in file
  504.        R4=direction (+1/-1)
  505.        R5=search flags (as for Zap_Search)
  506.        R8/R9=current window
  507.  
  508. Zap_Search
  509. Calls the Zap wildcard search code.
  510.  \E R0=pointer to search string
  511.     R1=output 0=to cursor 1=to buffer 2=no output
  512.        OR &100+offset of throwback window to add search matches to.
  513.     R3=start offset of the search (in the file)
  514.     R4=search direction +1/-1
  515.     R5=search flags b31=set for a raw search (don't search by lines)
  516.             b30=set if case sensitive
  517.             b29=set if macros shouldn't be expanded
  518.             b28=set if \commands should be ignored (and `s etc)
  519.             b27=set to search all windows (move to next one after)
  520.             b26=don't update hourglass in search_text
  521.             b25=don't beep if no match found
  522.             b24=return end of match offset in R1 (if one found)
  523.     R8/R9=current window of search
  524.  \X If R1=0 or 1 then output displayed
  525.     If R1=0 or 2 then R0=match offset on exit / -ve if none
  526.     If R1=1 then R0=offset of throwback window / -ve if none
  527.     R1=offset of end of match (if b24 of R5)
  528.  
  529. Zap_Select
  530. Selects a given region, and puts carets back to default mode.
  531.     \E R2=start offset R3=end offset R8/R9
  532.  
  533. Zap_AlterSel
  534. As for Zap_Select but doesn't restore caret modes.
  535.     \E R2=start offset R3=end offset R8/R9
  536.  
  537. Zap_OffLineCol
  538. Converts a file offset to and x,y coordinate in the window work area. See
  539. also Zap_FindOffset. See E-Windows.
  540.     \E R0=file offset R8/R9
  541.     \X R0=start of line offset
  542.        R2=column (inc margin)
  543.        R3=row
  544.  
  545. Zap_AddCommands
  546. Adds a table of commands to zap's list. Zap can currently cope with up to 16
  547. tables of commands. This should be called when a module initialises as for
  548. Zap_AddMode. Zap need not be mapped into memory for this call. See E-Commands
  549. for the table format.
  550.     \E R0=address of command table (R12=Zaps workspace).
  551.     
  552. Zap_MiniWrite
  553. This call sends a stream of characters to the minibuffer. The minibuffer
  554. contents is changed but not updated on screen. However, if this call is used
  555. within a command, then the minibuffer will updated on screen automatically
  556. by Zap. Use Zap_MiniUpdate to force an update, but you shouldn't have to use
  557. this. The minibuffer takes the form:
  558.     <prompt string><mark><user editable field>.
  559. The user cannot move the cursor before the 'invisible' mark. The string
  560. passed to Zap_MiniWrite may contain the following control codes:
  561.     0=string terminator
  562.     1=move cursor to mark (ctrl a)
  563.     2=8=move cursor back one character (ctrl b)
  564.     4=delete character after cursor (ctrl d)
  565.     5=move to end of string (ctrl e)
  566.     6=9=move cursor forward one character (ctrl f)
  567.     11=clear buffer from cursor (ctrl k)
  568.     12=clear whole buffer (ctrl l)
  569.     21=clear buffer from mark (ctrl u)
  570.     28=set mark to current cursor offset
  571.     127=delete character before cursor
  572. When a command with string parameter is called, R0 points to the user
  573. editable part of the string.
  574.     \E R0=pointer to zero terminated string
  575.     
  576. Zap_MiniPrompt
  577. This replaces the prompt string in the minibuffer with the given string. It's
  578. main use is for reason code R2=6 when a command with string parameter is
  579. called (see E-Commands). The buffer is not updated on screen (see
  580. Zap_MiniWrite). Unlike Zap_MiniWrite, the minibuffer cursor is not affected
  581. by this call (It remains the same number of characters after the mark).
  582.     \E R0=new prompt string
  583.     
  584. Zap_MiniUpdate
  585. This call updates the minibuffer on screen (if open). This will usually be
  586. done automatically by Zap.
  587.  
  588. Zap_AddYankRegion
  589. This call adds a region to the cut/paste kill ring. The region you pass it
  590. is not copied so must be stable (eg in a heap block).
  591.     \E R0=address of region + flags:
  592.         b31 MUST BE SET (If clear then denotes an undo buffer ref).
  593.         b30 If set, then after yanking this block, it will move onto
  594.             the block before (ie, yanks many blocks at once).
  595.        R1=block length (provided b31 of R0 is set).
  596.  
  597. Zap_FindCommand
  598. This call converts a command name into a command address by looking it up in Zaps command tables.
  599.     \E R0=command name terminated by <=32 or :,&,"
  600.     \X R0=command address / 0 if not found
  601.     
  602. Zap_ProcessCommand (see also Zap_CommandString).
  603.  This makes a call to a Zap command. It should be used for all calls to
  604. commands. You can find the address of a command via Zap_FindCommand. You
  605. may also call commands which may not have a name - it just considers the
  606. command address.
  607.  The data the command takes is pointed to in R0. The data format depends on
  608. the command. It should point to a list of bytes/word or a string depending on
  609. whether the command takes a byte/word or string parameter. It is undefined if
  610. the command takes no parameter. See E-Commands for more details. Put R0=0
  611. instead of the pointer to a string to open the minibuffer instead.
  612.  The number of times the key has 'auto-repeated' is passed in R1. This will
  613. be the length of the byte/word list if the command takes byte or word
  614. parameters. Usually put R1=1.
  615.  R2 holds the action code of the command. Action code 0 executes the command.
  616. The other action codes are used to read information about the command and are
  617. mainly used internally by Zap. See E-Commands for the details.
  618.  NB The mode e_aligncaret entry point will be called before all command calls
  619. using R2=0,1 on entry.
  620.  \E R0=pointer to command data (0 if there is no data)
  621.        R1=length of the command data if byte or word list (in bytes or
  622.           words). Number of times key has auto-repeated otherwise.
  623.        R2=Command action code:
  624.            b0-b27 = Action code to be passed to the command. 0 to
  625.                 execute it - see E-Command.
  626.            b28-b31= Flags to tell Zap_ProcessCommand things. These are
  627.                 filtered out before R2 is passed to the command.
  628.                 b31=Set if command should not be learnt even
  629.                     if in learn mode.
  630.              b30-b28 reserved.
  631.        R7=command address (need not point to a command registered in a
  632.                command table, but must conform to the specs in the
  633.                file E-Command. Eg, [R7,#-4] must be the flags word).
  634.        R8=window block pointer or 0 if none applicable (options menu)
  635.        R9=file block pointer or 0 if none applicable (options menu)
  636.        R10=input cursor (or cursor you wish command to act on) or 0
  637.            if not applicable.
  638.  \X R1-R13 preserved.
  639.     If action code=0 on entry then R0=0 or -1 if minibuffer opened.
  640.     If action code>0 on entry then R0=value in R0 when command returned.
  641.  
  642. Zap_FindKeyEntry
  643. This finds the entry corresponding to a given key and keymap. You might use
  644. it for redefining the key for instance. The block pointed to on exit has the
  645. format:
  646.     #0 Command address (or 0 if none - key is passed on to wimp)
  647.     #4 Command parameter, this depends on the command flags b3-7. If
  648.        these bits are:
  649.        0   => #4 undefined (should be 0)
  650.        1/2 => #4 is the byte or word to be added to the list to be
  651.              passed to the command when the key is pressed.
  652.        3   => #4=address of string parameter /0 if minibuffer should be
  653.               used.
  654.        4   => #4=address of the data block.
  655.     \E R0=keymap number R1=zaps key number (0-&1FF)
  656.     \X R0=entry for this key / 0 if keymap does not exist or key is
  657.        out of range.
  658.  
  659. Zap_FindLeafName
  660. This works out which part of a filename is the leafname.
  661.     \E R0=filename pointer
  662.     \X R0=pointer to the leafname part (within the filename).
  663.  
  664. Zap_NewFileName
  665. Change the name of a given file. You may have to call Zap_NewFileTitle to
  666. update the titlebars (this will usually be done by Zap_SaveFile).
  667.     \E R0=new file name R9
  668.     
  669. Zap_CheckFileName
  670. Decides whether a filename is a full path name (eg "ADFS::$.Wibble") or just
  671. the leaf name of a file (eg "Text1"). Should be used in conjunction with
  672. Zap_SaveFile as this will not save files without full path names.
  673.     \E R0=filename
  674.     \X R0=0 if it is a full path name / 1 otherwise
  675.  
  676. Zap_GetCurrDir
  677. Returns current directory (of the temporary filing system) which should be
  678. used as default string in minibuffer file operations. On RISC OS 2, there is
  679. no way of reading the current directory so this call returns the root
  680. directory on the current disc (via OS_Args 0, OS_FSControl 33, OS_GBPB 5). On
  681. RISC OS 3, the current directory is read via OS_Args 0, OS_FSControl 33, and
  682. OS_FSControl 54. NB The block it is returned in is not stable over calls to
  683. Zap. You may call Zap_MiniWrite passing this block but should copy the
  684. string for other calls.
  685.     \X R0=pointer to 256 byte buffer containing the directory name
  686.  
  687. Zap_MiniWriteC
  688. Writes a single character to the minibuffer. See Zap_MiniWrite for the
  689. character codes.
  690.     \E R0=character to insert in minibuffer.
  691.  
  692. Zap_MiniClear
  693. Clears minibuffer contents without updating on screen. Resets marks etc. You
  694. should use this before using Zap_MiniStart.
  695.  
  696. Zap_MiniStart
  697. This starts up the minibuffer. Do not use this call when writing a Zap
  698. command. Read the file E-Command to see how the minibuffer works in this
  699. case. You never need this call, Zap_ProcessCommand can open a minibuffer at
  700. any time if you feed it a string type command and R0=R2=0.
  701.     \E R7=address of command to be called when return pressed in
  702.        minibuffer. [R7,#-4] must contain the command flags word as
  703.        documented in E-Command.
  704.        R8/R9=window minibuffer should appear at.
  705.  
  706. Zap_MiniEval
  707. This turns a string into a number via OS_EvaluateExpression. It is usually
  708. called near the start of a command which expects to find a number in the
  709. minibuffer.
  710.     \E R0=string pointer (usually minibuffer pointer passed to you)
  711.     \X R0=number stored in string/CS if not a valid number.
  712.  
  713. Zap_CommandString (see also Zap_ProcessCommand)
  714. This call takes a command (or colon separated list of commands) in string
  715. form and executes them as typed. For example if R0="MODE 0" on entry then
  716. first of all a call to Zap_FindCommand will be made to find the address of
  717. the command "MODE" and then the command will be called via
  718. Zap_ProcessCommand with R2=0.
  719.     \E R0=command string (zero terminated)
  720.           Set b31 if you don't want the commands to be learnt if in
  721.           learn mode.
  722.     \X R0=0 or -1 if the minibuffer has been opened.
  723.  
  724. Zap_ProcessKeys
  725. This entry point accesses Zap's main key handling sub so you can simulate
  726. keypresses. If you just wish to simulate one key press, then it is easier to
  727. use the next call. This call is for multiple keypresses and buffers the data
  728. as much as possible before it has to call a command. You must keep calling
  729. this command until it returns R0<0 (as it will do if you put R5=-1 on entry -
  730. it uses the R5=-1 call to execute the buffered data).
  731.     \E R0=zap key number of next key to execute (if R5>=0)
  732.        R5=-1     => there are no more keys to buffer (R0 not defined).
  733.           0-&1FF => wimp key number of key to send to Wimp_ProcessKey
  734.                if no command is attached to the key.
  735.           &200   =>    if Wimp_ProcessKey should never be called.
  736.        R6=length of current buffering (set to 0 on first call)
  737.        R7=command currently being buffered (if R6>0)
  738.        R8-R10=input cursor
  739.     \X R0>=0 if you should call this sub again with the next key (or
  740.           R5=-1 if there are no more).
  741.        R0<0 if the command has finished processing all buffered data
  742.           so you needn't call it again.
  743.        R6/R7 are updated for the next call.
  744.        
  745. Zap_ProcessAKey
  746. This command simulates a key press by calling the above command twice, once
  747. with the key and then once with R5=-1.
  748.     \E R0=zap key number
  749.        R5=wimp key number (see Zap_ProcessKeys)
  750.        R8-R10=input caret
  751.  
  752. Zap_OpenWindow
  753. The current position of a Zap window can be read easily using the code:
  754.  MOV R1,R8 : SWI "XWimp_GetWindowState". However, you should not call
  755. Wimp_OpenWindow to open a window as Zap has to keep track of the title length
  756. and position of the minibuffer etc. You should use this call instead. Use
  757. call 0 where possible as it prevents titlebar flicker.
  758.     \E R0=type of open:
  759.         0 => Just changing scroll offsets or height in window stack.
  760.              Size/position of window NOT changing.
  761.         1 => Window may move/change size. Minibuffer, title bar
  762.              and cursors dealt with accordingly.
  763.         2 => Window is a new window. Toggle size data etc reset.
  764.         3 => Bring window to front of stack (ignore R1)
  765.         4 => Put window to back of stack (ignore R1)
  766.         5 => As for 0, but cursor kept within the window if the
  767.              'constrict cursor' option is on.
  768.         (NB type 2 calls type 1 calls type 5 calls type 0)
  769.        R1=open block (as for Wimp_OpenWindow)
  770.        R8=window block (NB Usually alter this block and let R1=R8)
  771.  
  772. Zap_RestoreModeWord
  773. This call should be used by your e_start entry point. If R8<>0 on entry then
  774. it reads the reads the options for the given mode from w_datablock using the
  775. call Zap_ModeData, and sets them as the current options. If R8=0 then it does
  776. the same thing but sets the default options.
  777.     \E R0=mode number
  778.        R8=window to restore options on / 0 for the default options.
  779.        
  780. Zap_SaveModeWord
  781. This call should be used by your e_end entry point. If R8<>0 on entry then it
  782. reads the words w_flags and w_format and stores the current options in the
  783. w_modedata block by use of the call Zap_ModeData. If R8=0 on entry then it
  784. reads opt_flags and opt_format and stores them as the default option etc.
  785.     \E R0=mode number
  786.        R8=window to save options on / 0 for the default options.
  787.  
  788. Zap_GetModeWord
  789. This call reads the contents of your mode word. If R8=0 then it reads
  790. opt_moden, otherwise it reads [R8,#w_moden]. This is useful for menu
  791. options.
  792.     \E R1=mode number
  793.        R8=window to get mode word / 0 for default options mode word
  794.     \X R0=mode word contents.
  795.     
  796. Zap_PutModeWord
  797. As above, but write the value.
  798.     \E R0=new value for the word
  799.        R1=mode number
  800.            R8=window to put mode word / 0 for default options mode word
  801.  
  802. Zap_BaseMode
  803. This call replaces Zap_CallBaseMode. It differs in that you must specify
  804. which mode is calling. This information is not necessarily available from
  805. the block in R8 if another mode is based on yours. The basemode of the mode
  806. named in R9 is called via the entry point offset given in R11. Before the
  807. entry point is actually called, R9 is converted to the file block pointer
  808. of the window specified in R8. Hence any entry point requiring R8 and R9
  809. set up on entry can be called ok.
  810.     \E R0-R7=parameters for the call
  811.        R8=window block to be used by the call.
  812.        R9=mode number making this call (your mode number).
  813.        R10=parameter for the call (usually cursor block pointer).
  814.        R11=mode entry point offset (see E-Entry) to call.
  815.     \X As for the given mode entry point.
  816.  
  817. Zap_ReadWord
  818. This call can be used for reading 4 byte from a file buffer. Note that
  819. although the offset of the word in the file may be word aligned, it's offset
  820. in the buffer may not be due to the split. This call reverses the word if the
  821. Big Endian flag is set.
  822.     \E R0=File offset of the word to be read
  823.        R8=window (for big endian flag to be read)
  824.        R9=file
  825.     \X R0=the word read (padded with zeros if it went off the file end).
  826.  
  827. Zap_ReplaceWord
  828. This call replaces a word at the given file offset (inserting if the file
  829. offset+4>file length) via Zap_Command. The word is reversed if the big endian
  830. flag is set.
  831.     \E R0=word to replace
  832.        R1=file offset
  833.        R8/R9 (R8 used for the big endian flag).
  834.  
  835. Zap_ModeColour
  836. This call reads or writes the colour definition table. It will not usually
  837. have immediate effect unless you recreate the window (eg Zap_NewWinStatus).
  838. You shouldn't usually access this data as Zap handles it all for you, except
  839. to write sensible default values (using R8=0) if your mode starts up and
  840. finds its mode word is zero.
  841.     \E R0=colour to write:
  842.           -1   => Don't write anything (just read the value)
  843.           b0-b7 <16 => Write this wimp colour (converting it to RGB)
  844.           b0-b7 >15 => Write 24 bit colour of the form &BBGGRRZZ
  845.                where ZZ is the Zap style (&10=base style)
  846.        R1=mode number
  847.        R2=Zap colour number of the colour to write/read:
  848.           0/1=Background 2=Foreground 3=Selection background
  849.           4=selection foreground 5=cursor back 6=cursor for
  850.           7=line numbers 8=control chars
  851.           9+ mode dependent extension colours.
  852.        R8=Window block to read from / 0 for default (!Config) settings.
  853.     \X R0=colour value read / old value if writing it. This is of the
  854.           form &BBGGRRZZ as above.
  855.  
  856. Zap_FindInput
  857. This call works out the current position of the 'input focus' in a window. If
  858. the input caret is in this window then it returns it's offset. Otherwise it
  859. returns the 'point' position (usually marked by an empty square).
  860.     \E R8/R9
  861.     \X R0=most suitable offset to insert data.
  862.  
  863. Zap_ClipCache
  864. This call moves the cache reference point (w_cline/coff/clogl etc) to a given
  865. point (using e_clnoff).
  866.     \E R0=Offset in line to move the cache reference point to. R8/R9
  867.  
  868. Zap_ModeData
  869. This call reads or write the mode dependant options that Zap handles
  870. automatically for you. See also Zap_ModeColour. Currently there is only one
  871. word per mode storing the width and things like whether auto-indent is on or
  872. not. You should use this call with R8=0 to write sensible default values if
  873. your mode starts up and finds its mode word is zero. If you don't then the
  874. default Text mode values will be used.
  875.     \E R0=value to write / -1 to read
  876.        R1=mode number
  877.        R2=variable number to read write
  878.        R8=window concerned / 0 for the default (!Config) settings.
  879.     \X R0=variable value if read / old value if written
  880.     Variables num:    0     b0-b15  stores the "width" for this mode
  881.                 b16    auto indent bit (b16 of w_format)
  882.                 b17     auto width bit (b6 of w_flags)
  883.                 b18    strip spaces bit (b18 of w_format)
  884.                 b19-b21 tab mode bits (b9-b11 of w_flags)
  885.                     b19-b20 0=Unix 1=Edit 2=Coltab
  886.                     b21=insert tabs as spaces
  887.                 b22    hex entry mode bit (b5 of w_flags)
  888.                 b23    overwrite bit (b1 of w_flags)
  889.                 b24-b31    display bits (b8-b15 of w_format)
  890.                     b24=line numbers shown
  891.                     b25=line numbers as lines (not addr)
  892.                     b26=line numbers in hex
  893.                     b27=logical line nums (not physical)
  894.                     b28-29 0=no tabs 1=spaces 2=> 3=->
  895.                     b30=line edit paradigm
  896.                     b31=non standard editing
  897.             1+    reserved.
  898.  
  899. Zap_WhichMode
  900. This call decides which mode a given file should be displayed in.
  901.     \E R0=load address of file (containing the filetype)
  902.        R1=filename pointer / 0 if not known
  903.     \X R0=flags    b0 => Auto load flag is set, no shift test.
  904.        R10=mode file should be loaded into.
  905.  
  906. Zap_ModeNumber
  907. This calls turns a mode name (given by a string) into a mode number.
  908.     \E R0=mode name string terminated by <= space (&20)
  909.     \X R0=mode number or -1 if not found.
  910.  
  911. Zap_SendDataSave
  912. This call initiates the save protocol, saving data to another window or
  913. application via RAM transfer or WimpScrap. It sends the data_save message and
  914. all replies are handled automatically.
  915.     \E R2=proposed file/leaf name of the data (or 0 to use the file's)
  916.        R3=destination window handle or task handle
  917.        R4=destination icon handle (if R3=-2)
  918.        R5/R6=destination mouse coords (if applicable)
  919.        R7=routine to call after save finished (or 0 if none).
  920.        R8/R9=R8<>0 => Save whole file R8=window block R9=file block
  921.             R8=0  => Save currently selected region.
  922.             (or set b1 of R10 to save an arbitrary region).
  923.        R10=b0-b15 flags:
  924.            b0 set => External edit flag. In this case R3=ext edit
  925.                 job handle and R4=ext edit task handle and
  926.                 external edit message sent instead.
  927.            b1 set => R8=start address of data to save
  928.                     R9=size of the data to save
  929.                     b12-b31 of R10=filetype of data to save.
  930.            b16-b31 = extra data (see b1)
  931.        R11=data to pass to routine in R7 (if used).
  932.     \X Data transfer protocol initiated.
  933.     Sub pointed to by R7 is called with R11 as passed above and should
  934.     preserve R1+ as usual.
  935.  
  936. Zap_Warning
  937. Warns the user without generating an error. This opens a window with the
  938. given message and pauses for the message to be seen before returning. Wimp
  939. Poll is not called.
  940.     \E R0=warning message
  941.        R1=time to leave message open in cs (0 for default delay)
  942.           + flags:
  943.            b31 => Don't beep when opening the window
  944.        R8/R9=window in which to show the warning.
  945.  
  946. Zap_AllWindow
  947. Calls a given subroutine once for each valid Zap window. See also
  948. Zap_EachWindow.
  949.     \E R0-R7=arguments to pass to the sub
  950.        R10=address of the sub to call (which must preserve all registers
  951.            except R0, and is called once for each window with R8/R9
  952.            set up to be that window).
  953.  
  954. Zap_ReadMenu
  955. Converts a text file of the same format of Zap's 'Menu' file into a Zap menu
  956. structure.
  957.     \E R0=start of a zero terminated menu text file (stored in memory)
  958.     \X R0=pointer to heap block containing the following information
  959.         #0 Number of valid menu handles for this file (first
  960.            number appearing in the file)
  961.         #4 Pointer to the menu structure (in Zap-Wimp format) for
  962.            handle 0 (or 0 if handle 0 not used)
  963.         #8 Pointer to structure for handle 1
  964.         #12 Pointer to structure for handle 2 etc.
  965.  
  966. Zap_LoadMenu
  967. Converts a text menu file to a Zap menu structure.
  968.     \E R0=pointer to filename of the menu file
  969.     \X R0=list of menu handles as for Zap_ReadMenu
  970.     
  971. Zap_OpenMenu
  972. Opens a menu on the screen. The menu structure is handled automatically once
  973. it has been opened.
  974.     \E R1=pointer to Zap-Wimp menu structure
  975.        R2=mouse x to open at
  976.        R3=mouse y to open at
  977.        R8/R9=window the menu is being opened on or 0's for none (eg the
  978.          iconbar menu).
  979.  
  980. Zap_CallBack
  981. Schedules a subroutine to be called again at a certain time but using wimp
  982. null events.
  983.     \E R1=(earliest) monotonic time to call back at (>0)
  984.           or -(smallest delay before calling back) =< 0.
  985.        R2=address of routine to call.
  986.        R3=data to pass to the routine in R11.
  987.     The routine pointed to by R2 has conditions:
  988.      \E R1=current time R11=value passed in R3
  989.      \X (must save R1+ as usual)
  990.  
  991. Zap_DragBox
  992. Starts a wimp drag box making sure you get called when it's finished.
  993.     \E R0=b0 set if you wish to be called repeatedly during the drag
  994.           b1+ reserved (set to 0)
  995.        R1=drag box block to be passed to Wimp_DragBox
  996.        R2=address of routine to call.
  997.        R3=data to pass to the routine in R11.
  998.     The routine pointed to by R2 has conditions:
  999.      \E R0=reason code 1=drag in progress 2=drag has just finished
  1000.         R1=drag box posn as returned by wimp if R0=2
  1001.         R11=value passed in R3
  1002.      \X (must save R1+ as usual)
  1003.      
  1004. Zap_SendMessage
  1005. Sends a wimp message and logs the message number (my_ref) so that any reply
  1006. can be forwarded to you. The message reference is held for at least a minute
  1007. and only deleted on a null event.
  1008.  E R0=b0-b27 message action number (to go in R1,#16)
  1009.       b28    set if you are interested in the reply.
  1010.       b29    set if you want to be called when message deleted
  1011.       b30-31 00 => Just send the message (with code 17)
  1012.           01 => Just acknowledge the message (with code 19)
  1013.           10 => Send the message recorded (with code 18) and call the
  1014.             reply code if the message replied to.
  1015.           11 => Send the message recorded (with code 18) and call the
  1016.             reply code if the message replied to or bounces.
  1017.    R1=message block
  1018.    R2=dest task handle/window handle
  1019.    R3=b31 clear => This is the message length (is rounded up to next word)
  1020.       b31 set   => This is the offset of a string ending the message.
  1021.    R4=icon handle if R2=-2 (iconbar) [not used otherwise]
  1022.    R5=address of routine to call when message replied to [if b28 of R0]
  1023.       (zero as a value means that you want any replies to be dealt with
  1024.        as if they were normal messages and not a reply)
  1025.    R6=private word to pass to routine on a reply [if b28 of R0]
  1026.  X The message is sent as an original message. Hence the my_ref, length
  1027.    and message action fields are filled in for you. R0=task handle of the
  1028.    dest task (R2 on exit from Wimp_SendMessage)
  1029.      Routine in R5 called with:
  1030.          ;E R0=message type
  1031.              0 => message being removed from log list (see b29)
  1032.              17 => message replied to as normal
  1033.              19 => message bounced
  1034.             R1=message block
  1035.             R2=message number (R1!16) R11=private word R12=Zap's etc
  1036.          ;X You can corrupt R0-R11 if R0=17,19
  1037.             You should save R1-R11 if R0=0
  1038.  
  1039. Zap_Reply
  1040. Replies to a message. It copies my_ref to your_ref for you can reads the task
  1041. handle of the task to reply to from the message block. The length word is
  1042. assumed to be unchanged.
  1043.  E R0=message action number (as for SendMessge)
  1044.    R1=message block (with ref etc)
  1045.    R5/R6=rountine to handle the reply if b28 of R0 (as for SendMessage)
  1046.  
  1047. Zap_Extend
  1048. Changes the size of a heap block, making it smaller or bigger as for OS_Heap
  1049. with the extend action code.
  1050.  \E R0=pointer to the heap block R1=signed change in the size
  1051.  \X R0=new heap block pointer (it may have moved)
  1052.  
  1053. Zap_ModeColourNum
  1054. Reads/writes the size of the colour palette used by a given mode. Maximum
  1055. size of a palette is currently 256 colours. Use R8=0 to read the default
  1056. values. NB If you enlarge the palette then please write some sensible values
  1057. for the new entries!
  1058.  \E R0=new size of palette (in number of colours) / -1 to read
  1059.     R1=mode number R8/R9=window or R8=0 for the default options.
  1060.  \X R0=old size / read size.
  1061.  
  1062. Zap_CreateThrowback
  1063. Creates a throwback buffer ready for lines being inserted by Zap_Throwback.
  1064.  ;E R0=suggested width of window / 0 to use default width
  1065.  ;X R0=window offset of window R8/R9=newly created throwback window
  1066.  
  1067. Zap_Throwback
  1068. Inserts a line in a throwback file for you.
  1069.  \E R0=file offset or line number of line with info on it
  1070.        set b31 to supress this being printed automatically.
  1071.     R1=filename (of the file that R0 is an offset in)
  1072.     R2=information string to print after the line number (eg "Bad syntax")
  1073.     R3=string to precede filename  (eg "Errors in file:")
  1074.     R4=file offset of linked file / -1 if may not be loaded
  1075.     R5=flags to use for the new entry (see f_links,#12)
  1076.     R6=string to precede new info block (eg "Line num  Error")
  1077.     R7=string to go after filename (eg 10,"Search string: fred")
  1078.     R8/R9=throwback window to add entry to
  1079.  \X Throwback entry added and new title block given if file (or flags)
  1080.     have changed KB #
  1081.     The line number field is 10 characters wide if not supressed.
  1082.